package map.android.baidu.carpool.data;

import android.content.Context;
import com.baidu.lbs.net.http.model.ComNetData;
import com.baidu.lbs.net.http.model.IDataStatusChangedListener;
import com.baidu.lbs.net.http.response.ComNetResponse;

import java.util.Map;

/**
 * Created by zhangtongyu on 15/3/20.
 * 请求接口的基类
 */
public class CarpoolBaseData <T extends ComNetResponse> extends ComNetData<T>{


    public CarpoolBaseData(Context context) {

        super(context);
    }

    public CarpoolBaseData(Context context , boolean sig){
        super(context,sig);
    }

    @Override
    public void get(IDataStatusChangedListener<T> listener) {
        this.addOnDataStatusChangedListener(listener);
        this.mDataStatus = 1;
        mHttpClient.get(this.getUrl(), new CarpoolRequestParam(this.getParams(), this.mSig), this.mJsonResponseHandler);
    }

    @Override
    public void post(IDataStatusChangedListener<T> listener) {
        this.addOnDataStatusChangedListener(listener);
        this.mDataStatus = 1;
        mHttpClient.post(this.getUrl(), new CarpoolRequestParam(this.getParams(), this.mSig), this.mJsonResponseHandler);
    }

    @Override
    protected String getUrl() {
        return "";
    }

    @Override
    protected Map<String, String> getParams() {

        return null;
    }



}
